#include <QCoreApplication>
#include <QThread>
#include <QObject>
#include <QDebug>
#include "seeqobject.h"
#include "WokerQObject.h"


int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    QThread::currentThread()->setObjectName("Main");
    qDebug() << QThread::currentThread();

    QObject obj;
    qDebug() << obj.thread();

    WorkerThread workerThread;
    qDebug() << workerThread.thread();
    workerThread.start();
    workerThread.wait();

    QThread thread;
    Worker worker;
    worker.moveToThread(&thread);
    QObject::connect(&thread,&QThread::started,&worker,&Worker::Start);
    thread.start();
    QObject::connect(&thread,&QThread::finished,&worker,&QObject::deleteLater);



    return a.exec();
}
